<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html;charset=UTF-8"/>
    <link th:href="@{/bootstrap/css/bootstrap.css}" rel="stylesheet"/>
    <link th:href="@{/bootstrap/css/bootstrap.min.css}" rel="stylesheet"/>
    <script th:src="@{/jq/jquery-1.11.2.min.js}" type="text/javascript"></script>
    <script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
    <script th:inline="javascript">
        var single = [[${single}]];
        console.log(single.name);
        function getUser(name){
            alert(name);
        }
    </script>
    <title>用户</title>
</head>
<body>
<div>
    adaf
</div>
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">访问model</h3>
        </div>
        <div class="panel-body">
            <span th:text="${single.name}"></span>
        </div>
    </div>

    <div th:if="${not #lists.isEmpty(users)}">
        <div class="panel-heading">
            <h3 class="panel-title">列表</h3>
        </div>
        <div class="panel-body">
            <ul class="list-group">
                <li class="list-group-item" th:each="user:${users}">
                    <input type="checkbox" th:value="${user.id}"/>
                    <span th:text="${user.name}"></span>
                    <span th:text="${user.age}"></span>
                    <span th:text="${user.qq}"></span>
                    <span th:text="${user.phone}"></span>
                    <button class="button" th:onclick="'getUser(\''+${user.name}+'\');'">查看信息</button>
                </li>
            </ul>
        </div>
    </div>
</body>
</html>